{% extends "base.html" %}

{% load gaev_extras %}

{% block content %}
{% if entity_set_actions %}
	<div>
	{% for action in entity_set_actions %}
		<a href="{{ action.url }}">{{ action.caption }}</a>
	{% endfor %}
	</div>
{% endif %}
<table>
<thead>
	<tr>
	<th></th>
	{% for col in cols %}
	    <th>{{ captions|attr:col }}</th>
	{% endfor %}
	</tr>
</thead>
<tbody>
{% for row in rows %}
	<tr>
		<th class="index_row_actions">
		{% for action in row.actions %}
		<a class="action_link" href="{{ action.url }}">{% if action.imageUrl %}<img src="{{ action.imageUrl }}">{% else %}{{action.caption }} {% endif %}</a>
		{% endfor %}
		</th>
	{% for col in cols %}
	    <td>{{ row|attr:col|truncate:50 }}</td>
	{% endfor %}
	</tr>
{% endfor %}

</tbody>
</table>
{% if pagination %}
	<div>
	{% for page in pagination %}
		{% if page.1 %}
		<a href="{{page.1}}">{{page.0}}</a>
		{% else %}
		{{page.0}}
		{% endif %}
	{% endfor %}
	</div>
{% endif %}
{% endblock %}